package com.ruoyi.project.system.user.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import com.ruoyi.framework.config.RuoYiConfig;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.project.system.menu.domain.Menu;
import com.ruoyi.project.system.menu.service.IMenuService;
import com.ruoyi.project.system.user.domain.User;

/**
 * 首页 业务处理
 * 
 * @author ruoyi
 */
@Controller
public class IndexController extends BaseController
{
    @Autowired
    private IMenuService menuService;

    @Autowired
    private RuoYiConfig ruoYiConfig;

    // 系统首页
    @GetMapping("/index")
    public String index(Model model)
    {
        // 取身份信息
        User user = getUser();
        // 根据用户id取出菜单
        List<Menu> menus = menuService.selectMenusByUserId(user.getUserId());
        model.addAttribute("menus", menus);
        model.addAttribute("user", user);
        model.addAttribute("copyrightYear", ruoYiConfig.getCopyrightYear());
        return "index";
    }

    // 系统介绍
    @GetMapping("/system/main")
    public String main(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "main";
    }
    // 
    @GetMapping("/system/wc")
    public String wc(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "wc";
    }
    // 舆情热度分析
    @GetMapping("/system/hotweek")
    public String hotweek(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "hotweek";
    }
    @GetMapping("/system/hotseason")
    public String hotseason(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "hotseason";
    }
    @GetMapping("/system/hot")
    public String hot(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "hot";
    }
    
    // 搜索词分析
    @GetMapping("/system/word")
    public String word(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "word";
    }
    // 搜索词1分析
    @GetMapping("/system/wordweek")
    public String wordweek(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "wordweek";
    }
    // 搜索词2分析
    @GetMapping("/system/wordmonth")
    public String wordmonth(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "wordmonth";
    }
    // 媒体分析
    @GetMapping("/system/meiti")
    public String meiti(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "meiti";
    }
    // 受众分析
    @GetMapping("/system/audiences")
    public String audiences(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "audiences";
    }
    // 舆情预测
    @GetMapping("/system/forecast")
    public String forecast(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "forecast";
    }
 // 舆情预测
    @GetMapping("/system/forecastjiao")
    public String forecastjiao(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "forecastjiao";
    }
 // 舆情预测
    @GetMapping("/system/forecastan")
    public String forecastan(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "forecastan";
    }
 // 舆情预测
    @GetMapping("/system/forecastyu")
    public String forecastyu(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "forecastyu";
    }
 // 舆情预测
    @GetMapping("/system/forecastxue")
    public String forecastxue(Model model)
    {
        model.addAttribute("version", ruoYiConfig.getVersion());
        return "forecastxue";
    }
 
}
